# PRODUCT INFO
skip_phases = ["buildinstall", "productimg", "extra_files"]
release_name = '[[ release.id_prefix.title() ]]'
release_short = '[[ release.id_prefix.title() ]]'
release_version = '[[ release.version_int ]]'
release_type = 'updates[% if request.name == 'testing' %]-testing[% endif %]'
release_is_layered = False
old_composes_per_release_type = True

# GENERAL SETTINGS
comps_file = {
    'scm': 'git',
    'repo': 'https://pagure.io/fedora-comps.git',
    'branch': None, # defaults to cvs/HEAD or git/master
    'file': 'comps-[[ release.branch ]].xml',
    'command': 'make',
}
variants_file='variants.xml'
sigkeys = [
[% if release.version_int == 25 %]
    'fdb19c98',
[% elif release.version_int == 26 %]
    '64dab85d',
[% elif release.version_int == 27 %]
    'f5282ee4',
[% elif release.version_int == 28 %]
    '9db62fb1',
[% elif release.version_int == 6 %]
    '0608b895',
[% elif release.version_int == 7 %]
    '352C64E5',
[% endif %]
{% if env == "staging" %}
    None
{% endif %}
]
hashed_directories = True

# RUNROOT settings
runroot = True
runroot_channel = 'compose'
runroot_tag = 'f[[ release.version_int ]]-build'

# PKGSET
pkgset_source = 'koji' # koji, repos
pkgset_koji_tag = '[[ id ]]'
pkgset_koji_inherit = False
filter_system_release_packages = False

# GATHER
gather_method = 'deps'
gather_backend = 'dnf'
check_deps = False
greedy_method = 'build'
repoclosure_backend = 'dnf'

# CREATEREPO
createrepo_c = True
createrepo_checksum = 'sha256'
createrepo_deltas = [
    ('^Everything$', {'*': True})
]

# CHECKSUMS
media_checksums = ['sha256']
media_checksum_one_file = True
media_checksum_base_filename = 'Fedora-%(variant)s-%(version)s-%(date)s.%(respin)s-%(arch)s'
#jigdo
create_jigdo = False

additional_packages = [
    ('^Everything$', {
        '*': [
            '*',
        ],
    }),
]
multilib = [
    ('^Everything$', {
        'x86_64': ['devel', 'runtime'],
         's390x': ['devel', 'runtime']
    })
]
filter_packages = []
# format: {arch|*: [packages]}
multilib_blacklist = {
    '*': ['kernel*', 'kernel-PAE*', 'kernel*debug*',
        'dmraid-devel', 'kdeutils-devel', 'mkinitrd-devel',
        'java-1.5.0-gcj-devel', 'java-1.7.0-icedtea-devel',
        'php-devel', 'java-1.6.0-openjdk-devel',
        'java-1.7.0-openjdk-devel', 'java-1.8.0-openjdk-devel',
        'httpd-devel', 'tomcat-native', 'php*', 'httpd',
        'krb5-server', 'krb5-server-ldap', 'mod_*', 'ghc-*'
    ],
}
# format: {arch|*: [packages]}
multilib_whitelist = {
    '*': ['libgnat', 'wine*', 'lmms-vst', 'nspluginwrapper',
        'libflashsupport', 'valgrind', 'perl-libs', 'redhat-lsb',
        'yaboot', 'syslinux-extlinux-nonlinux', 'syslinux-nonlinux',
        'syslinux-tftpboot', 'nosync', '*-static'
    ],
}
createiso_skip = [
        ('^Everything$', {
            '*': True,
            'src': True
        }),
    ]

{% if env != "staging" %}
[% if release.id_prefix == 'FEDORA' and release.version_int >= 26 %]
ostree = {
    "^Everything$": [
        # Atomic Host
        {
            [% if release.version_int >= 28 %]
                "version": "!VERSION_FROM_VERSION_DATE_RESPIN",
            [% endif %]
            "treefile": "fedora-atomic-host-updates-[[ request.name ]].json",
            "config_url": "https://pagure.io/fedora-atomic.git",
            "config_branch": "f[[ release.version ]]",
            "repo": [
                "Everything",
                [% if request.name == 'testing' %]
                    # In the case of testing, also inject the last stable updates
                    "https://kojipkgs{{ env_suffix }}.fedoraproject.org/compose/updates/f[[ release.version_int ]]-updates/compose/Everything/$basearch/os/",
                [% endif %]
                # For f28 the compose location is under /compose/branched/
                [% if release.version_int == 28 %]
                    "https://kojipkgs{{ env_suffix }}.fedoraproject.org/compose/branched/latest-Fedora-[[ release.version_int ]]/compose/Everything/$basearch/os/"
                [% else %]
                    "https://kojipkgs{{ env_suffix }}.fedoraproject.org/compose/[[ release.version_int ]]/latest-Fedora-[[ release.version_int ]]/compose/Everything/$basearch/os/"
                [% endif %]
            ]
            "ostree_repo": "/mnt/koji/compose/atomic/repo",
            "tag_ref": False,
            "arches": ["x86_64",
                       [% if release.version_int >= 27 %]
                       "ppc64le", "aarch64"
                       [% endif %]
                      ],
            [% if release.version_int >= 27 %]
                "failable": ["ppc64le", "aarch64"],
            [% endif %]
        },
        # Atomic Workstation
        [% if release.version_int >= 27 %]
        {
            [% if release.version_int >= 28 %]
                "version": "!VERSION_FROM_VERSION_DATE_RESPIN",
            [% endif %]
            [% if release.version_int >= 28 %]
                "treefile": "fedora-atomic-workstation-updates-[[ request.name ]].json",
        [% else %]
                "treefile": "fedora-ostree-workstation-updates-[[ request.name ]].json",
        [% endif %]
            "config_url": "https://pagure.io/workstation-ostree-config.git",
            "config_branch": "f[[ release.version ]]",
            "repo": [
                "Everything",
                [% if request.name == 'testing' %]
                    # In the case of testing, also inject the last stable updates
                    "https://kojipkgs{{ env_suffix }}.fedoraproject.org/compose/updates/f[[ release.version_int ]]-updates/compose/Everything/$basearch/os/",
                [% endif %]
                # For f28 the compose location is under /compose/branched/
                [% if release.version_int == 28 %]
                    "https://kojipkgs{{ env_suffix }}.fedoraproject.org/compose/branched/latest-Fedora-[[ release.version_int ]]/compose/Everything/$basearch/os/"
                [% else %]
                    "https://kojipkgs{{ env_suffix }}.fedoraproject.org/compose/[[ release.version_int ]]/latest-Fedora-[[ release.version_int ]]/compose/Everything/$basearch/os/"
                [% endif %]
            ]
            "ostree_repo": "/mnt/koji/compose/atomic/repo",
            "tag_ref": False,
            "arches": ["x86_64"],
            "failable": ["x86_64"]
        },
        [% endif %]
    ]
}
[% endif %]

[% if release.id_prefix == 'FEDORA' and release.version_int >= 28 and request.name == 'testing' %]
global_ksurl = 'git+https://pagure.io/fedora-kickstarts.git?#origin/f[[ release.version_int ]]'
global_release = '!RELEASE_FROM_LABEL_DATE_TYPE_RESPIN'
image_name_format = '%(release_short)s-%(variant)s-%(disc_type)s-%(arch)s-%(version)s-%(date)s%(type_suffix)s.%(respin)s.iso'
image_volid_formats = [
    '%(release_short)s-%(variant)s-%(disc_type)s-%(arch)s-%(version)s'
    ]
volume_id_substitutions = {
    'AtomicHost': 'AH',
    'Everything': 'E',
}

# Other ostree artifacts
image_build = {
    '^AtomicHost$': [
        {
            'image-build': {
                'format': [('qcow2', 'qcow2'), ('raw-xz', 'raw.xz')],
                'name': 'Fedora-Atomic',
                'kickstart': 'fedora-atomic.ks',
                'distro': 'Fedora-22',
                'disk_size': 6,
                'target': 'f[[ release.version_int ]]',
                'arches': ['x86_64', 'aarch64', 'ppc64le'],
                'install_tree_from': "https://kojipkgs{{ env_suffix }}.fedoraproject.org/compose/branched/latest-Fedora-[[ release.version_int ]]/compose/Everything/$arch/os/"
                'subvariant': 'AtomicHost',
                'failable': ['*'],
            }
        }
    ]
}

ostree_installer = [
    ('^AtomicHost$', {
        [% for arch in ['x86_64', 'aarch64', 'ppc64le'] %]
            '[[ arch ]]': {
                "repo": [
                    "Everything",
                    [% if request.name == 'testing' %]
                        # In the case of testing, also inject the last stable updates
                        "https://kojipkgs{{ env_suffix }}.fedoraproject.org/compose/updates/f[[ release.version_int ]]-updates/compose/Everything/[[arch]]/os/",
                    [% endif %]
                    # For f28 the compose location is under /compose/branched/
                    [% if release.version_int == 28 %]
                        "https://kojipkgs{{ env_suffix }}.fedoraproject.org/compose/branched/latest-Fedora-[[ release.version_int ]]/compose/Everything/[[arch]]/os/"
                    [% else %]
                        "https://kojipkgs{{ env_suffix }}.fedoraproject.org/compose/[[ release.version_int ]]/latest-Fedora-[[ release.version_int ]]/compose/Everything/[[arch]]/os/"
                    [% endif %]
                ],
            'release': None,
            'rootfs_size': '4',
            'add_template': ['ostree-based-installer/lorax-configure-repo.tmpl',
                             'ostree-based-installer/lorax-embed-repo.tmpl'],
            'add_template_var': [
                'ostree_install_repo=https://kojipkgs.fedoraproject.org/atomic/repo/',
                'ostree_update_repo=https://dl.fedoraproject.org/atomic/repo/',
                'ostree_osname=fedora-atomic',
                'ostree_install_ref=fedora/[[ release.version_int ]]/[[ arch ]]/[% if request.name == "testing" %]testing[% else %]updates[% endif %]/atomic-host',
                'ostree_update_ref=fedora/[[ release.version_int ]]/[[ arch ]]/atomic-host',
            ],
            'template_repo': 'https://pagure.io/fedora-lorax-templates.git',
            'template_branch': 'f[[ release.version_int ]]'
            'failable': ['*'],
        },
        [% endfor %]
    })
]
[% endif %]
{% endif %}

translate_paths = [
   ('/mnt/koji/compose/', 'https://kojipkgs{{ env_suffix }}.fedoraproject.org/compose/'),
]
koji_profile = 'bodhi_koji'
link_type = 'hardlink-or-copy'
